package com.dkm.ec.product.repository.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.product.domain.ProdRec;
import com.dkm.ec.product.persistence.dao.ProdRecQueryDao;
import com.dkm.ec.product.persistence.entity.ProdRecPo;
import com.dkm.ec.product.repository.ProdRecRepository;

/**
 * 对象功能:关联产品推荐 Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:Yuki
 * 创建时间:2015-02-28 18:15:41
 */
@Repository
public class ProdRecRepositoryImpl extends AbstractRepository<String, ProdRecPo,ProdRec> implements ProdRecRepository{
	  
	@Resource
	private  ProdRecQueryDao prodRecQueryDao;

	public ProdRec newInstance() {
		ProdRecPo po = new ProdRecPo();
		ProdRec prodRec = SpringHelper.getBean(ProdRec.class);
		prodRec.setData(po);
		return prodRec;
	}

	public ProdRec newInstance(ProdRecPo po) {
		ProdRec prodRec = SpringHelper.getBean(ProdRec.class);
		prodRec.setData(po);
		return prodRec;
	} 
	
	@Override
	protected IQueryDao<String, ProdRecPo> getQueryDao() {
		return prodRecQueryDao;
	}

	@Override
	public List<ProdRecPo> getProdRecList(String baseId, String typeKey) {
		return prodRecQueryDao.getProdRecListByBaseIdAndTypeKey(baseId, typeKey);
	}
	@Override
	public List<ProdRecPo> getProdRecListByBaseIds(String baseIds, String typeKey) {
		return prodRecQueryDao.getProdRecListByBaseIdsAndTypeKey(baseIds, typeKey);
	}

}
